package com.caption.api.controller;

import com.caption.api.entity.IDCarAuthCondition;
import com.caption.api.entity.IDCarAuthResultDTO;
import com.caption.api.manager.ApiManager;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@RequestMapping("/hello")
public class HelloController {
    @Autowired
    private ApiManager apiManager;

    @GetMapping("/say")
    public void sayHello(){
        IDCarAuthCondition condition = new IDCarAuthCondition();
        apiManager.setHandler(condition,"1.0");
        IDCarAuthResultDTO idCarAuthResultDTO = apiManager.call();
        System.out.println(idCarAuthResultDTO.getCode());
    }
}
